
import 'package:demo202112/flutterlaoutPage.dart';
import 'package:flutter/material.dart';

class StatefullGroup extends StatefulWidget {
  @override
  _StatefullGroupState createState() => _StatefullGroupState();
}

class _StatefullGroupState extends State<StatefullGroup> {
  @override
  Widget build(BuildContext context) {
    int _currentIndex = 1;
    return Scaffold(
        appBar: AppBar(title: Text("测试导航"),


        ),
        body:_currentIndex==0 ? Container(
          decoration: BoxDecoration(color: Colors.white),
          alignment: Alignment.center,
          child: Column(
            children: [
              Text("ffffffff"),
            ],
          ),
        ):RefreshIndicator(child: ListView(children: [Container(child: Text("刷新"),),
          Image.network("http://cools.qctt.cn/1638795273533?imageView2/1/w/750/h/560/"),
          TextField(),

        ],), onRefresh: handelrefredsh),
        bottomNavigationBar: BottomNavigationBar(

          items: [
            BottomNavigationBarItem(
                icon: Icon(Icons.home),
                label: "首页",
                activeIcon: Icon(
                  Icons.home,
                  color: Colors.blue,
                )),
            BottomNavigationBarItem(
                icon: Icon(Icons.video_call),
                label: "视频",
                activeIcon: Icon(
                  Icons.home,
                  color: Colors.blue,
                )),
          ],
          currentIndex: _currentIndex,
          onTap: (int index) {
            setState(() {
              _currentIndex=index;
            });
          },
        ),
        floatingActionButton: FloatingActionButton(onPressed: (){
              Navigator.push(context, MaterialPageRoute(builder: (context)=>FlutterLayoutPage()));

        }),
      );

  }
  Future<Null>handelrefredsh()async{
    await Future.delayed(Duration(milliseconds: 500));
    return null;
  }
}
